package com.itheima.mapper;

import com.itheima.pojo.Member;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface MobileMemberMapper {
    /**
     * 根据手机号查询会员
     * @param telephone
     * @return
     */
    @Select("select * from t_member where phoneNumber = #{telephone}")
    Member findMemberByTelephone(String telephone);

    /**
     * 添加会员
     * @param member
     */
    @Insert("insert into t_member(fileNumber,name,sex,idCard,phoneNumber,regTime,password,email,birthday,remark) " +
            "values(#{fileNumber},#{name},#{sex},#{idCard},#{phoneNumber},#{regTime},#{password},#{email},#{birthday},#{remark})")
    void insertMember(Member member);
}
